package Task28;

import java.util.ArrayList;

public class Result {
	private ArrayList<String> errors=new ArrayList<String>();
	private ArrayList<String> exceptions=new ArrayList<String>();
	private ArrayList<String> data=new ArrayList<String>();
	private ArrayList<String> message=new ArrayList<String>();
	
	public ArrayList<String> getErrors() {
		return errors;
	}
	public void addErrors(ArrayList<String> errors) {
		this.errors.addAll(errors);
	}
	public void addErrors(String errors) {
		this.errors.add(errors);
	}
	public ArrayList<String> getExceptions() {
		return exceptions;
	}
	public void addExceptions(ArrayList<String> exceptions) {
		this.exceptions.addAll(exceptions);
	}
	public void addExceptions(String exceptions) {
		this.exceptions.add(exceptions);
	}
	public ArrayList<String> getData() {
		return data;
	}
	public void addData(ArrayList<String> data) {
		this.data.addAll(data);
	}
	public void addData(String data) {
		this.data.add(data);
	}
	public ArrayList<String> getMessage() {
		return message;
	}
	public void addMessage(ArrayList<String> message) {
		this.message.addAll(message);
	}
	public void addMessage(String message) {
		this.message.add(message);
	}
	
	public void addResult(Result result){
		this.data.addAll(result.getData());
		this.errors.addAll(result.getErrors());
		this.exceptions.addAll(result.getExceptions());
		this.message.addAll(result.getMessage());
	}
	public boolean containProblems(){
		return !this.getErrors().isEmpty() || !this.getExceptions().isEmpty();
	}
}
